import styles from "./style.module.less";
import { homeRoute, overviewRoute } from "@/routes/config";
export default defineComponent({
  props: {
    isRegisterRouter: {
      type: Boolean,
      default: true,
    },
  },
  setup(props) {
    const router = useRouter();
    return () => (
      <div class={styles.container404}>
        <h1 class={styles.title}>404</h1>
        <div class={styles.desc}>
          {props.isRegisterRouter
            ? "PAGE NOT FOUND"
            : "THE ROUTE NOT REGISTERED"}
        </div>
        <a-button
          type="primary"
          onClick={() =>
            $addTags({
              name: overviewRoute.meta.title,
              path: overviewRoute.path,
              callback: () => router.replace(overviewRoute.path),
            })
          }
        >
          {{ icon: () => <arrow-left-outlined />, default: () => "回到首页" }}
        </a-button>
      </div>
    );
  },
});
